<template>
	<view class="scrool-page">
		<!-- <view class="header-cont"></view> -->
		<view class="list-cont">
			<scroll-view class="scrool-more" style="height: 100%" scroll-y="true" scroll-with-animation="true">
				<view v-for="(item,index) in detailList" :key="index">
					<uni-card :title="'托号:'+panelCode" v-if='item.isFreeze' style='background-color: darkgrey;'>
						<text class="uni-body">物料编码：{{ item.itemCode }}</text><br>
						<text class="uni-body">数量：{{ item.codeEqualQty }}</text><br>
						<text class="uni-body">当前库位：{{ item.storageArea }}</text><br>
						<text class="uni-body">批次号：{{ item.batchCode }}</text><br>
						<text class="uni-body">箱号：{{ item.boxCode }}</text><br>
					</uni-card>
					<uni-card :title="'托号:'+panelCode" v-else>
						<text class="uni-body">物料编码：{{ item.itemCode }}</text><br>
						<text class="uni-body">数量：{{ item.codeEqualQty }}</text><br>
						<text class="uni-body">当前库位：{{ item.storageArea }}</text><br>
						<text class="uni-body">批次号：{{ item.batchCode }}</text><br>
						<text class="uni-body">箱号：{{ item.boxCode }}</text><br>
					</uni-card>
				</view>
			</scroll-view>
		</view>

		<view class="footer">
			<button type="default" size="mini" @click="reduceBox" style="width:48%; margin-left:1%;"
				v-if='!this.userflag'>减箱</button>
			<button type="default" size="mini" @click="reduceBox" style="width:48%; margin-left:1%;" v-else>加箱</button>
			<button type="default" size="mini" @click="sumbit" style="width:49%; margin-left:1%;">完成</button>
		</view>

		<uni-popup ref="alertDialog" type="dialog" :is-mask-click="false">
			<uni-popup-dialog type="success" cancelText="关闭" confirmText="确定" title="请扫描物料编码和数量" :before-close="true"
				:content="alertContent" @confirm="dialogConfirm" @close="dialogClose">
			</uni-popup-dialog>
		</uni-popup>

		<!-- 若该库位不是该箱的推荐库位，则给予提示 -->
		<uni-popup ref="tipDialog" type="dialog" :is-mask-click="false">
			<uni-popup-dialog type="success" cancelText="关闭" confirmText="确定" title="提示" :before-close="true"
				:content="tipContent" @confirm="tipConfirm" @close="tipClose">
			</uni-popup-dialog>
		</uni-popup>
	</view>
</template>

<script>
	import Vue from 'vue'
	import {
		getToken
	} from '@/utils/auth';
	import common from '../../pages/common/common.js'
	var main, receiver, filter;
	var ScanDeviceClass = plus.android.importClass("android.device.ScanDevice");
	var scanDevice;
	const printer = uni.requireNativePlugin('LcPrinter');
	const modal = uni.requireNativePlugin('modal');
	var globalEvent = uni.requireNativePlugin('globalEvent');
	export default {
		data() {
			return {
				detailList: [],
				needAdd: [],
				scanedList: [],
				packageId: '',
				custName: '',
				custCode: '',
				panelCode: '',
				userflag: false,
				code: '',
				boxNum: 0,
				childBoxNum: 0,
				isFreeze: false,
				alertDialog: '',
				alertContent: '',
				number: '',
				itemCode: '',
				boxCode: '',
				datas: {},
				tipContent: '',
				panelLineid: '',
				storageArea: '',
				baseUrl: getApp().globalData.config.baseUrl,
				userName: this.$store.state.user.name,
				orgId: getApp().globalData.config.orgId,
				total: 0,
				scanNum: 0,
				lastAddCode: '',
				lastRecCode: '',
				title: '',
				itemCodeSet: [],
				batchCodeFlag: true,
				fullContaine: '',
				boxQty: '',
				codeEqualQty: '',
				newcountNum: ''
			}
		},

		onLoad: function(option) { //option为object类型，会序列化上个页面传递的参数
			this.orgId = uni.getStorageSync('orgId');
			//this.detailList = JSON.parse(decodeURIComponent(option.detailList));
			//this.needAdd = JSON.parse(decodeURIComponent(option.needAdd));
			this.itemCodeSet = JSON.parse(decodeURIComponent(option.itemCodeSet));
			this.packageId = option.packageId;
			this.custName = option.custName;
			this.custCode = option.custCode;
			this.panelCode = option.panelCode;
			this.boxNum = option.boxNum;
			this.status = option.status;
			this.title = option.title;
			this.fullContaine = option.fullContaine;
			this.postNum = option.postNum
			this.boxName = option.boxName
			this.boxQty = option.boxQty
			this.countSum();
			// 添加打印状态监听
			globalEvent.addEventListener('onPrintCallback', function(e) {
				// uni.showToast({
				// 	title: 'state: ' + JSON.stringify(e),
				// 	duration: 2000
				// });
				if (e.key == 0) {
					// uni.showToast({
					// 	title: '打印成功',
					// 	duration: 2000
					// });
				} else if (e.key == 3) {
					uni.showToast({
						title: '缺纸',
						duration: 2000
					});
				}
			});
			//打印机版本获取回调
			globalEvent.addEventListener('onVersion', function(e) {
				// uni.showToast({
				// 	title: 'version: ' + JSON.stringify(e),
				// 	duration: 2000
				// });
			});

			globalEvent.addEventListener('getsupportprint', function(e) {
				//console.log('key: ' + JSON.stringify(e));
				// uni.showToast({
				// 	title: 'key: ' + JSON.stringify(e),
				// 	duration: 2000
				// });
			});
		},

		onShow() {
			this.orgId = uni.getStorageSync('orgId');
			scanDevice = new ScanDeviceClass();
			scanDevice.openScan(); // 打开扫描
			scanDevice.setOutScanMode(0); // 扫描模式	
			this.initScan();
			this.registerScan();
			if (this.fullContaine == 'true') {
				this.uninit()
			} else {
				this.init();
			}

		},

		onHide: function() {
			this.unregisterScan();
		},

		destroyed: function() {
			this.unregisterScan();
		},


		//返回上一页
		onBackPress(options) {
			if (options.from === 'navigateBack') {
				return false;
			}
			this.childBoxNum = 0;
			for (var i = 0; i < this.detailList.length; i++) {
				if (this.detailList[i].isFreeze) {
					this.childBoxNum = this.childBoxNum + 1;
				}
			}
			//this.unregisterScan();
			//player.stop();
			let pages = getCurrentPages(); //获取所有页面栈实例列表
			let nowPage = pages[pages.length - 1]; //当前页页面实例
			let prevPage = pages[pages.length - 2]; //上一页页面实例
			prevPage.$vm.init();
			// for(var i=0;i<prevPage.$vm.productList.length;i++){
			// 	if(prevPage.$vm.productList[i].panelCode == this.panelCode){
			// 		prevPage.$vm.productList[i].childList = this.detailList;
			// 		prevPage.$vm.productList[i].needAdd = this.needAdd;
			// 		prevPage.$vm.productList[i].childBoxNum = this.childBoxNum;
			// 		break;
			// 	}
			// }			
			setTimeout(function() {
				uni.navigateBack({ //uni.navigateTo跳转的返回，默认1为返回上一级
					delta: 1
				});
			}, 1500);
			return true;
		},


		onNavigationBarButtonTap(e) {
			console.log(e);
			if (this.fullContaine == 'true') {
				this.uninit()
			} else {
				this.init();
			}
		},
		methods: {
			initScan() {
				let _this = this;
				main = plus.android.runtimeMainActivity(); //获取activity  
				var IntentFilter = plus.android.importClass('android.content.IntentFilter');
				filter = new IntentFilter();
				filter.addAction("scan.rcv.message"); // 换你的广播动作  
				receiver = plus.android.implements('io.dcloud.feature.internal.reflect.BroadcastReceiver', {
					onReceive: function(context, intent) {
						plus.android.importClass(intent);
						let code = intent.getByteArrayExtra('barocode');
						let codeStr = common.utf8ByteToUnicodeStr(code);
						scanDevice.stopScan(); // 停止扫描	
						if (_this.status == '2') {
							uni.showToast({
								title: '任务已挂起，请先恢复',
								icon: 'none',
								duration: 3000
							});
							return;
						}

						if (_this.status == '3') {
							uni.showToast({
								title: '任务已完成，不能修改',
								icon: 'none',
								duration: 3000
							});
							return;
						}
						var result = common.scanCode(codeStr);
						if (result[0] == "P") {
							_this.itemCode = result[1];
							_this.alertContent = '物料编码：' + _this.itemCode + "\n" + "数量：" + _this.number +
								"\n" + '箱码：' + _this.boxCode + '\n';
						} else if (result[0] == "Q") {
							_this.number = result[1];
							_this.alertContent = '物料编码：' + _this.itemCode + "\n" + "数量：" + _this.number +
								"\n" + '箱码：' + _this.boxCode + '\n';
						} else if (result[0] == "C") {
							if (!_this.userflag) {
								if (_this.lastAddCode == result[1]) {
									return;
								} else {
									_this.lastAddCode = result[1];
									_this.lastRecCode = "";
								}
							} else {
								if (_this.lastRecCode == result[1]) {
									return;
								} else {
									_this.lastAddCode = '';
									_this.lastRecCode = result[1];
								}
							}
							_this.boxCode = result[1];
							_this.scanJudge(result[1]);
							_this.reduceBoxDetaile(result[1]);
						} else {
							uni.showToast({
								title: '请正确扫描条码',
								icon: 'none',
								duration: 3000
							});
							return;
						}
					}
				});
			},

			// 整数装箱调用
			init() {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var that = this;
				let token = getToken();


				uni.request({
					//url:that.baseUrl+'/system/pkgplan/select/vitoplan',
					url: that.baseUrl + "/system/pkgplan/recommend/childs",
					data: {
						packageId: that.packageId,
						orgId: that.orgId,
						userName: that.userName,
						valueName: 'warehouse', //字典
						panelCode: that.panelCode,
						itemCodeSet: that.itemCodeSet,
						boxNum: that.boxNum,
						custName: that.custName,
						custCode: that.custCode,
						boxQty: that.boxQty
					},
					method: 'POST',
					header: {
						'authorization': token
					},
					dataType: 'json',
					success: (res) => {
						console.log(res.data);
						if (res.data.code == '200') {
							var result = JSON.stringify(res.data.data)
							if (result == null || result == '' || result == '{}' || result.length == 0) {
								//隐藏加载框
								uni.hideLoading();
								uni.showToast({
									title: '无数据',
									icon: 'none',
									duration: 3000
								});
								return;
							}
							that.detailList = res.data.data;
							that.total = that.detailList.length;
							that.countSum();
							//隐藏加载框
							uni.hideLoading();
						} else if (res.data.code == '50000') { //20240205判断组托计划锁定
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 5000
							});
						} else {
							//隐藏加载框
							uni.hideLoading();
							uni.showToast({
								title: '查询出错',
								icon: 'none',
								duration: 3000
							});
						}
					}
				})
			},
			// 非整数装箱
			uninit() {
				//显示加载框
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var that = this;
				let token = getToken();
				uni.request({
					//url:that.baseUrl+'/system/pkgplan/select/vitoplan',
					url: that.baseUrl + "/system/pkgplan/recommend/childs/boxs",
					data: {
						packageId: that.packageId,
						orgId: that.orgId,
						userName: that.userName,
						valueName: 'warehouse', //字典
						panelCode: that.panelCode,
						itemCodeSet: that.itemCodeSet,
						boxNum: that.boxNum,
						custName: that.custName,
						custCode: that.custCode,
						postNum: that.postNum,
						boxName: that.boxName
					},
					method: 'POST',
					header: {
						'authorization': token
					},
					dataType: 'json',
					success: (res) => {
						console.log(res.data);
						if (res.data.code == '200') {
							var result = JSON.stringify(res.data.data)
							if (result == null || result == '' || result == '{}' || result.length == 0) {
								//隐藏加载框
								uni.hideLoading();
								uni.showToast({
									title: '无数据',
									icon: 'none',
									duration: 3000
								});
								return;
							}
							that.detailList = res.data.data;
							that.total = that.detailList.length;
							that.countSum();
							//隐藏加载框
							uni.hideLoading();
						} else {
							//隐藏加载框
							uni.hideLoading();
							uni.showToast({
								title: '查询出错',
								icon: 'none',
								duration: 3000
							});
						}
					}
				})
			},

			registerScan() {
				main.registerReceiver(receiver, filter);
			},

			unregisterScan() {
				main.unregisterReceiver(receiver);
			},

			// 顶部导航条显示内容
			countSum() {
				var count = 0;
				var countNum = 0;
				console.log(this.detailList)
				for (var i = 0; i < this.detailList.length; i++) {
					if (this.detailList[i].isFreeze) {
						count = count + 1;
						countNum = countNum + Number(this.detailList[i].codeEqualQty)
					}
				}
				console.log(countNum)
				this.newcountNum = countNum
				this.scanNum = count;
				uni.setNavigationBarTitle({
					title: '箱数：' + '(' + this.scanNum + '/' + this.total + ')' + '物料数：' + '(' + countNum + '/' +
						this.postNum + ')'
				});
				//隐藏加载框
				uni.hideLoading();
			},

			//扫描时做判断，如果产品被锁定提示，没有锁定更新
			scanJudge(codeStr) {
				var that = this;
				if (that.userflag) {
					return;
				}
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				if (codeStr.substring(0, 1) == 'P' || codeStr.substring(0, 1) == 'Q') {
					uni.showToast({
						title: '请正确扫描批次号',
						icon: 'none',
						duration: 2000
					});
					return;
				}
				that.childBoxNum = 0;
				for (var i = 0; i < that.detailList.length; i++) {
					if (that.detailList[i].isFreeze) {
						that.childBoxNum = that.childBoxNum + 1;
					}
				}
				// if (this.fullContaine == 'true') {

				// } else {
				console.log(that.boxNum)
				console.log(that.childBoxNum)
				if (that.boxNum == that.childBoxNum) {
					//隐藏加载框
					uni.hideLoading();
					uni.showToast({
						title: '此托已满，不允许再次增加',
						icon: 'none',
						duration: 3000
					});
					return;
				}
				// }

				for (var i = 0; i < that.detailList.length; i++) {
					if (that.detailList[i].isFreeze && that.detailList[i].boxCode == codeStr) {
						//隐藏加载框
						uni.hideLoading();
						uni.showToast({
							title: '此箱已被扫描，不允许再次扫描',
							icon: 'none',
							duration: 3000
						});
						return;
					}
				}
				//根据箱号查询条码主档
				uni.request({
					url: that.baseUrl + '/system/barcode/box',
					data: {
						userName: that.userName,
						boxCode: codeStr,
						orgId: that.orgId,
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						console.log(res)
						if (res.data.code == '200' || res.data.code == 200) {
							var result = res.data.data;
							this.codeEqualQty = res.data.data.codeEqualQty
							if (result.isFreeze == '1') {
								//隐藏加载框
								uni.hideLoading();
								uni.showToast({
									title: '此箱已被占用，不能组托',
									icon: 'none',
									duration: 5000
								});
								return;
							}
							if (result.isStocked == '0') {
								//隐藏加载框
								uni.hideLoading();
								uni.showToast({
									title: '此箱不在库，不能组托',
									icon: 'none',
									duration: 5000
								});
								return;
							}
							if (result.occupation == '1') {
								//隐藏加载框
								uni.hideLoading();
								uni.showToast({
									title: '此箱已冻结，不能组托',
									icon: 'none',
									duration: 5000
								});
								return;
							}
							//下面开始判断是走越库，正常流程，还是已经越库完成
							//隐藏加载框
							uni.hideLoading();
							that.branch(result);
						} else {
							//隐藏加载框
							uni.hideLoading();
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 5000
							});
							return;
						}

					},
				})
			},

			branch(result) {
				console.log(result)
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var that = this;
				if (result.storageArea == null || result.storageArea == '') {
					//隐藏加载框
					uni.hideLoading();
					uni.showToast({
						title: '此箱还未到达待入库区，不允许操作',
						icon: 'none',
						duration: 2000
					});
					return;
				} else if (result.storageArea == 'R') { //已经到达待入库区，走越库流程					
					//1.先比较物料
					var tempList = [];
					for (var i = 0; i < that.detailList.length; i++) {
						var data = that.detailList[i];
						if (data.itemCode == result.itemCode && !data.isFreeze) {
							tempList.push(data);
						}
					}
					if (tempList.length == 0) {
						//隐藏加载框
						uni.hideLoading();
						uni.showToast({
							title: '该物料编码' + result.itemCode + '不属于该组托计划',
							icon: 'none',
							duration: 5000
						});
						return;
					}
					//2.在比较数量
					var tempList2 = [];
					if (this.fullContaine == 'true') {

						for (var i = 0; i < tempList.length; i++) {
							var data = tempList[i];
							console.log(data)
							if (!data.isFreeze) {
								data.codeEqualQty = result.codeEqualQty
								console.log(data)
								tempList2.push(data);
							}
						}

					} else {
						for (var i = 0; i < tempList.length; i++) {
							var data = tempList[i];
							if (data.codeEqualQty == result.qty && !data.isFreeze) {
								tempList2.push(data);
							}
						}
						if (tempList2.length == 0) {
							//隐藏加载框
							uni.hideLoading();
							uni.showToast({
								title: '箱容数' + result.qty + "与该组托计划中该物料的箱容数不匹配",
								icon: 'none',
								duration: 5000
							});
							return;
						}
					}
					//隐藏加载框
					uni.hideLoading();
					uni.showModal({
						title: '提示',
						content: '此箱还未上架是否触发越库流程?',
						success: function(res) {
							if (res.confirm) {
								//that.unregisterScan();
								var url = '/pages/special/overStock'
								uni.navigateTo({
									url: url
								});
							} else {
								return;
							}
						}
					})

				} else if (result.storageArea == 'CH') { //已经到达待出库区，越库流程已完成
					//先找需要扫描越库的数据
					uni.showLoading({
						title: '加载中',
						mask: true
					});
					var tempList = [];
					for (var i = 0; i < that.detailList.length; i++) {
						var data = that.detailList[i];
						if (data.itemCode == result.itemCode && (data.batchCode == null || data.batchCode == '') && !data
							.isFreeze) {
							tempList.push(data);
						}
					}
					if (tempList.length == 0) {
						//1.先比较物料
						for (var i = 0; i < that.detailList.length; i++) {
							var data = that.detailList[i];

							if (data.itemCode == result.itemCode && !data.isFreeze) {
								tempList.push(data);
							}
						}
						if (tempList.length == 0) {
							//隐藏加载框
							uni.hideLoading();
							uni.showToast({
								title: '该物料编码' + result.itemCode + '不属于该组托计划',
								icon: 'none',
								duration: 5000
							});
							return;
						}
						//2.在比较数量
						var tempList2 = [];
						console.log(data)
						console.log(result)
						if (this.fullContaine == 'true') {

							for (var i = 0; i < tempList.length; i++) {
								var data = tempList[i];
								console.log(data)
								if (!data.isFreeze) {
									data.codeEqualQty = result.codeEqualQty
									console.log(data)
									tempList2.push(data);
								}
							}

						} else {

							for (var i = 0; i < tempList.length; i++) {
								var data = tempList[i];

								if (data.codeEqualQty == result.qty && !data.isFreeze) {
									tempList2.push(data);
								}
							}
							if (tempList2.length == 0) {
								//隐藏加载框
								console.log('出库')
								uni.hideLoading();
								uni.showToast({
									title: '箱容数' + result.qty + "与该组托计划中该物料的箱容数不匹配",
									icon: 'none',
									duration: 5000
								});
								return;
							}
						}
						//3.开始处理
						var data = tempList2[0];
						var updateFlag = false;
						var record = '';
						for (var i = 0; i < that.detailList.length; i++) {
							if (that.detailList[i].itemCode == data.itemCode && that.detailList[i].codeEqualQty == data
								.codeEqualQty && !that.detailList[i].isFreeze) {
								updateFlag = true;
								that.detailList[i].storageArea = result.storageArea;
								that.panelLineid = that.detailList[i].panelLineid;
								record = that.detailList[i];
								break;
							}
						}
						if (updateFlag) {
							that.updatePackage(record);
						}
					} else {
						//再看数量或者货物能不能对应上
						var tempList2 = [];
						for (var i = 0; i < tempList.length; i++) {
							var data = tempList[i];
							if (result.itemCode == data.itemCode && result.qty == data.codeEqualQty && !data.isFreeze) {
								tempList2.push(data);
							}
						}
						if (tempList2.length == 0) {
							//隐藏加载框
							uni.hideLoading();
							uni.showToast({
								title: '该物料编码' + result.itemCode + '不属于该组托计划或箱容数' + result.qty +
									"与组托计划中该物料的箱容数不匹配",
								icon: 'none',
								duration: 5000
							});
							return;
						}
						var data = tempList2[0];
						var updateFlag = false;
						var record = '';
						for (var i = 0; i < that.detailList.length; i++) {
							if (that.detailList[i].itemCode == data.itemCode && that.detailList[i].codeEqualQty == data
								.codeEqualQty && !that.detailList[i].isFreeze &&
								(that.detailList[i].batchCode == null || that.detailList[i].batchCode == "")) {
								updateFlag = true;
								that.detailList[i].storageArea = result.storageArea;
								that.panelLineid = that.detailList[i].panelLineid;
								record = that.detailList[i];
								break;
							}
						}
						if (updateFlag) {
							that.updatePackage(record);
						}
					}
				} else { //走正常的流程
					uni.showLoading({
						title: '加载中',
						mask: true
					});
					var tempList = [];
					//1.先比较物料
					for (var i = 0; i < that.detailList.length; i++) {
						var data = that.detailList[i];
						if (data.itemCode == result.itemCode && !data.isFreeze) {
							tempList.push(data);
						}
					}
					if (tempList.length == 0) {
						//隐藏加载框
						uni.hideLoading();
						uni.showToast({
							title: '该物料编码' + result.itemCode + '不属于该组托计划',
							icon: 'none',
							duration: 5000
						});
						return;
					}
					//2.在比较数量
					var tempList2 = [];
					if (this.fullContaine == 'true') {


						for (var i = 0; i < tempList.length; i++) {
							var data = tempList[i];
							console.log(data)
							if (!data.isFreeze) {
								data.codeEqualQty = result.codeEqualQty
								console.log(data)
								tempList2.push(data);
							}
						}
						console.log(tempList2)
					} else {

						for (var i = 0; i < tempList.length; i++) {
							var data = tempList[i];
							if (data.codeEqualQty == result.qty && !data.isFreeze) {
								tempList2.push(data);
							}
						}

						if (tempList2.length == 0) {
							//隐藏加载框
							console.log('走正常的流程')
							uni.hideLoading();
							uni.showToast({
								title: '箱容数' + result.qty + "与该组托计划中该物料的箱容数不匹配",
								icon: 'none',
								duration: 5000
							});
							return;
						}
					}
					//3.在比较批次号。有的话变黑，没有的话，找第一条没有冻结的
					var tempList3 = [];
					for (var i = 0; i < tempList2.length; i++) {
						var data = tempList2[i];
						if (data.batchCode == result.batchNumber && !data.isFreeze) {
							tempList3.push(data);
						}
					}
					var batchNoFlag = true; //是否存在一致的批次号的标志，默认有
					if (tempList3.length == 0) {
						tempList3 = tempList2;
						batchNoFlag = false;
					}
					//4.再看库位是否一致，一致变灰，不一致给出提示
					var tempEqualList = [];
					var tempNotEqualList = [];
					for (var i = 0; i < tempList3.length; i++) {
						var data = tempList3[i];
						if (data.storageArea == result.storageArea && !data.isFreeze) {
							tempEqualList.push(data);
						} else if (data.storageArea != result.storageArea && !data.isFreeze) {
							tempNotEqualList.push(data);
						}
					}
					//5.开始做处理					
					if (tempEqualList.length > 0) {
						var data = tempEqualList[0];
						that.datas = data;
						var updateFlag = false;
						var record = '';
						if (batchNoFlag) {
							for (var i = 0; i < that.detailList.length; i++) {
								if (data.itemCode == that.detailList[i].itemCode && data.codeEqualQty == that.detailList[i]
									.codeEqualQty &&
									result.batchNumber == that.detailList[i].batchCode && result.storageArea == that
									.detailList[i].storageArea && !that.detailList[i].isFreeze) {
									updateFlag = true;
									record = that.detailList[i];
									break;
								}
							}
							if (updateFlag) {
								that.updatePackage(record);
							}
						} else {
							for (var i = 0; i < that.detailList.length; i++) {
								if (data.itemCode == that.detailList[i].itemCode && data.codeEqualQty == that.detailList[i]
									.codeEqualQty &&
									result.storageArea == that.detailList[i].storageArea && !that.detailList[i].isFreeze) {
									updateFlag = true;
									record = that.detailList[i];
									that.tipContent = '实际批次' + result.batchNumber + '与推荐批次' + that.detailList[i]
										.batchCode + '不一致，是否继续？';
									that.batchCodeFlag = false
									//隐藏加载框
									uni.hideLoading();
									that.$refs.tipDialog.open();
									break;
								}
							}
						}
					} else {
						if (tempNotEqualList.length > 0) {
							var data = tempNotEqualList[0];
							that.datas = data;
							if (batchNoFlag) {
								for (var i = 0; i < that.detailList.length; i++) {
									if (data.itemCode == that.detailList[i].itemCode && data.codeEqualQty == that
										.detailList[i].codeEqualQty &&
										data.batchCode == that.detailList[i].batchCode && !that.detailList[i].isFreeze) {
										that.tipContent = '实际库位' + result.storageArea + '与推荐库位' + that.detailList[i]
											.storageArea + '不一致，是否继续？';
										that.storageArea = result.storageArea;

										//隐藏加载框
										uni.hideLoading();
										that.$refs.tipDialog.open();
										break;
									}
								}
							} else {
								for (var i = 0; i < that.detailList.length; i++) {
									if (data.itemCode == that.detailList[i].itemCode && data.codeEqualQty == that
										.detailList[i].codeEqualQty &&
										!that.detailList[i].isFreeze) {
										that.tipContent = '实际批次' + result.batchNumber + '与推荐批次' + that.detailList[i]
											.batchCode + '不一致，是否继续？';
										that.storageArea = result.storageArea;
										that.batchCodeFlag = false
										//隐藏加载框
										uni.hideLoading();
										that.$refs.tipDialog.open();
										break;
									}
								}
							}
						}
					}
				}
			},

			updatePackage(data) {
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				console.log(this.batchCodeFlag)
				console.log(this.userName)
				uni.request({
					url: this.baseUrl + '/system/pkgline/plan',
					data: {
						packageId: this.packageId,
						custCode: this.custCode,
						boxcode: this.boxCode,
						panelCode: this.panelCode,
						panelLineid: data.panelLineid,
						itemcode: data.itemCode,
						type: 'edit',
						orgId: this.orgId,
						userName: this.userName,
						batchCodeFlag: this.batchCodeFlag,
						codeEqualQty: this.codeEqualQty
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						//console.log(res)
						if (res.data.code == '200' || res.data.code == 200) {
							this.batchCodeFlag = true
							data.boxCode = this.boxCode;
							data.batchCode = data.boxCode.substring(0, 9);
							if (this.storageArea != null && this.storageArea != '') {
								data.storageArea = this.storageArea;
							}
							// this.scanNum = this.scanNum+1;
							// uni.setNavigationBarTitle({
							// 	title:this.custName+'('+this.scanNum+'/'+this.total+')'
							// });							
							data.isFreeze = true;
							this.countSum();
							this.prompt();
							//that.scanedList.push(data);
						} else if (res.data.code == '50000') { //20240205判断组托计划锁定
							uni.showToast({
								duration: 4000,
								icon: 'none',
								title: '该组托计划正在做变更已被锁定,不允许操作!'
							})
						} else {
							//隐藏加载框
							uni.hideLoading();
							if (res.data.msg == '295') {
								uni.showToast({
									title: "此箱已被扫描",
									icon: 'none',
									duration: 2000
								});
								return;
							} else {
								uni.showToast({
									title: res.data.msg,
									icon: 'none',
									duration: 2000
								});
								return;
							}

						}

					},
				})
			},

			//扫描时做判断看看扫描的在不在这个物料中，在的话加箱，不在的话不让加给出提示
			addBox(data, codeStr, id, code, detailList, needAdd) {
				this.$refs.alertDialog.open();
				var flag = false;
				this.alertContent = '物料编码：' + this.itemCode + "\n" + "数量：" + this.number + "\n" + '箱码：' + codeStr + '\n';
			},

			//减码
			reduceBox() {
				var that = this;
				if (that.status == '2') {
					uni.showToast({
						title: '任务已挂起，请先恢复',
						icon: 'none',
						duration: 3000
					});
					return;
				}

				if (that.status == '3') {
					uni.showToast({
						title: '任务已完成，不能修改',
						icon: 'none',
						duration: 3000
					});
					return;
				}

				if (!that.userflag) {
					uni.showModal({
						title: '提示',
						content: '是否进行减码操作？',
						success: function(res) {
							if (res.confirm) {
								if (that.userflag) {
									that.userflag = false;
								} else {
									that.userflag = true;
								}
							} else if (res.cancel) {
								return;
							}
						}
					})
				} else {
					if (that.userflag) {
						that.userflag = false;
					} else {
						that.userflag = true;
					}
				}
			},

			reduceBoxDetaile(codeStr) {
				if (!this.userflag) {
					return;
				}
				//先找需要扫描越库的数据
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var flag = false;
				var data = '';
				var tempList = [];
				var dataList = [];
				for (var i = 0; i < this.detailList.length; i++) {
					//data = this.detailList[i];									
					if (this.detailList[i].boxCode == codeStr && this.detailList[i].isFreeze) {
						data = this.detailList[i];
						flag = true;
						console.log(data)
						dataList.push(data);
						// if(!data.isAdd){
						// 	tempList.push(data);
						// }
						//break;
					} else {
						tempList.push(this.detailList[i]);
					}
				}
				if (!flag) {
					//隐藏加载框
					uni.hideLoading();
					uni.showToast({
						title: '此数据不存在或未添加到此托中',
						icon: 'none',
						duration: 2000
					});
					return;
				} else {
					uni.request({
						url: this.baseUrl + '/system/pkgline/plan',
						//url:'https://4o9p085589.goho.co/system/pkgline/plan',
						data: {
							boxcode: codeStr,
							// packageId : this.packageId,
							// panelLineid:data.panelLineid,
							productList: dataList,
							type: 'reduce',
							orgId: this.orgId,
							userName: this.userName,
							panelCode: this.panelCode,
							packageId: this.packageId
						},
						method: 'POST',
						header: {
							'authorization': getToken()
						},
						dataType: 'json',
						success: (res) => {
							if (res.data.code == '200') {
								data.isFreeze = false;
								data.boxCode = '';
								if (data.storageArea == "CH") {
									data.batchCode = '';
								}
								tempList.push(data);
								// if(this.scanNum > 0){
								// 	this.scanNum = this.scanNum-1;
								// 	uni.setNavigationBarTitle({
								// 		title:this.custName+'('+this.scanNum+'/'+this.total+')'
								// 	});
								// }
								this.countSum();
								this.prompt();
								if (this.fullContaine == 'true') {
									this.uninit()
								} else {
									this.init();
								}
							} else if (res.data.code == '50000') { //20240205判断组托计划锁定
								uni.showToast({
									duration: 4000,
									icon: 'none',
									title: '该组托计划正在做变更已被锁定,不允许操作!'
								})
							} else {
								//隐藏加载框
								uni.hideLoading();
								uni.showToast({
									title: res.data.msg,
									icon: 'none',
									duration: 2000
								});
								return;
							}
						}
					})
				}
			},

			//拆托
			removeAllBox() { //这个得考虑是批量还是单个调用后台？
				var tempList = [];
				for (var i = 0; i < this.detailList.length; i++) {
					var data = this.detailList[i];
					if (!data.isAdd) {
						tempList.push(data);
					}
					if (data.isFreeze) {
						uni.request({
							url: '',
							data: {
								batch_code: codeStr,
							},
							method: 'POST',
							header: {
								'authorization': getToken()
							},
							dataType: 'json',
							success: (res) => {
								data.isFreeze = false;
								if (data.isAdd) { //是0说明是强制加箱的，得从列表中删除
									this.detailList.slice(i, 1);
								}
								console.log(res);
							}
						})
					}
				}
			},

			sumbit() {
				if (this.status == '2') {
					uni.showToast({
						title: '任务已挂起，请先恢复',
						icon: 'none',
						duration: 3000
					});
					return;
				}

				if (this.status == '3') {
					uni.showToast({
						title: '任务已完成，不能修改',
						icon: 'none',
						duration: 3000
					});
					return;
				}
				//先找需要扫描越库的数据
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				let that = this;
				that.childBoxNum = 0;
				that.childqualQty = 0
				console.log(that.detailList)
				for (var i = 0; i < that.detailList.length; i++) {
					if (that.detailList[i].isFreeze) {
						that.childqualQty = that.childqualQty + Number(that.detailList[i].codeEqualQty)
						that.childBoxNum = that.childBoxNum + 1;
					}
				}
				//校验前台扫描的数据是否正确
				var sum = ''
				uni.request({
					url: that.baseUrl + '/system/pkgline/temporaryOrFormal',
					data: {
						packageId: that.packageId,
						panelCode: that.panelCode,
						productList: that.detailList,
						orgId: that.orgId,
						title: that.title,
						countNum: that.newcountNum
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						console.log(res)

						if (res.data.code == 200) {
							//0不相等，1相等

							if (res.data.msg === '0') {
								uni.showToast({
									duration: 4000,
									icon: 'none',
									title: '页面显示数据不准确，请点击左上角刷新，刷新数据！'
								})

							} else {
								console.log(that.childqualQty)
								console.log(that.postNum)
								if (that.postNum < that.childqualQty) {
									uni.showModal({
										title: '提示',
										content: '下架数量高于组托数量',
										success: function(res) {
											if (res.confirm) {
												uni.hideLoading();
												console.log('comfirm') //点击确定之后执行的代码
											} else {
												uni.hideLoading();
												console.log('cancel') //点击取消之后执行的代码
											}
										}
									})
								} else
								if (that.postNum > that.childqualQty) {
									//隐藏加载框
									uni.hideLoading();
									uni.showModal({
										title: '提示',
										content: '此托尚未完成是否打印临时托码？',
										success: function(res) {
											if (res.confirm) {
												//先找需要扫描越库的数据
												uni.showLoading({
													title: '加载中',
													mask: true
												});
												uni.request({
													url: that.baseUrl + '/system/barcode',
													data: {
														packageId: that.packageId,
														panelCode: that.panelCode,
														productList: that.detailList,
														sourceBill: 'WM_PACKAGE_PLAN_TL',
														orgId: that.orgId,
														title: that.title,
														userName: that.userName,
													},
													method: 'POST',
													header: {
														'authorization': getToken()
													},
													dataType: 'json',
													success: (res) => {
														//隐藏加载框
														uni.hideLoading();
														if (res.data.code == 200) {
															var msg = res.data.msg;
															var ret = printer
																.initPrinter({});
															printer.printEnableMark({
																enable: true
															});
															printer.setConcentration({ //设置打印浓度。font_level 取值范围：1~39。
																level: 39
															});
															printer.setLineSpacing({
																spacing: 0
															});
															printer.getsupportprint();

															printer.setFontSize({
																fontSize: 0
															});
															printer.setTextBold({
																bold: true
															});
															printer.printBarcode({
																text: 'T' +
																	msg,
																height: 100,
																barcodeType: 73,
																offset: 1
															});
															printer.printText2({
																offset: 1,
																fontSize: 5,
																isBold: false,
																isUnderLine: false,
																content: 'T' +
																	msg,
															});
															printer.start();
															//that.unregisterScan();
															//player.stop();
															let pages =
																getCurrentPages(); //获取所有页面栈实例列表
															let nowPage = pages[pages
																.length - 1]; //当前页页面实例
															let prevPage = pages[pages
																.length - 2]; //上一页页面实例
															prevPage.$vm.init();
															setTimeout(function() {
																uni.navigateBack({ //uni.navigateTo跳转的返回，默认1为返回上一级
																	delta: 1
																});
															}, 1000);
														}
													}
												})
											} else if (res.cancel) {
												let pages = getCurrentPages(); //获取所有页面栈实例列表
												let nowPage = pages[pages.length - 1]; //当前页页面实例
												let prevPage = pages[pages.length - 2]; //上一页页面实例
												prevPage.$vm.init();
												setTimeout(function() {
													uni.navigateBack({ //uni.navigateTo跳转的返回，默认1为返回上一级
														delta: 1
													});
												}, 1000);
												//that.reduceUsed();
											}
										}
									});
								} else {
									console.log(that.detailList)
									uni.request({
										url: this.baseUrl + '/system/record/packageid/panelcode',
										//url: this.baseUrl + '/system/record/packageid/panelcode/box',
										data: {
											packageId: that.packageId,
											panelCode: that.panelCode,
											orgId: that.orgId,
											title: that.title,
											userName: that.userName,
											boxList: that.detailList,
											sourceBill: 'WM_PACKAGE_PLAN',
										},
										method: 'POST',
										header: {
											'authorization': getToken()
										},
										dataType: 'json',
										success: (res) => {
											console.log(res)
											//隐藏加载框
											uni.hideLoading();
											if (res.data.code == '200') {
												var msg = res.data.msg;
												var json = JSON.parse(msg);
												var qrcodeContent = 'T' + json.qrcodeContent;
												var attr4 = json.attr4;
												var ret = printer.initPrinter({});
												printer.printEnableMark({
													enable: true
												});
												printer.setConcentration({ //设置打印浓度。font_level 取值范围：1~39。
													level: 39
												});
												printer.setLineSpacing({
													spacing: 1
												});
												printer.getsupportprint();

												printer.setFontSize({
													fontSize: 5
												});
												printer.setTextBold({
													bold: true
												});
												printer.printQR2({
													text: qrcodeContent,
													height: 250,
													offset: 2
												});
												printer.printText2({
													offset: 2,
													fontSize: 2,
													isBold: false,
													isUnderLine: false,
													content: qrcodeContent + "\n",
												});
												printer.printText2({
													offset: 2,
													fontSize: 4,
													isBold: false,
													isUnderLine: false,
													content: attr4,
												});
												printer.start();
												//that.unregisterScan();
												//player.stop();
												let pages = getCurrentPages(); //获取所有页面栈实例列表
												let nowPage = pages[pages.length - 1]; //当前页页面实例
												let prevPage = pages[pages.length - 2]; //上一页页面实例
												prevPage.$vm.init();
												for (var i = 0; i < prevPage.$vm.productList
													.length; i++) {
													if (prevPage.$vm.productList[i].panelCode ==
														this.panelCode) {
														prevPage.$vm.productList[i].attr2 = '10';
														break;
													}
												}
												setTimeout(function() {
													uni.navigateBack({ //uni.navigateTo跳转的返回，默认1为返回上一级
														delta: 1
													});
												}, 1000);
											} else if (res.data.code == '201') {
												uni.showToast({
													title: res.data.msg,
													icon: 'none',
													duration: 4000
												});
												//that.unregisterScan();
												//player.stop();
												setTimeout(function() {
													let pages =
														getCurrentPages(); //获取所有页面栈实例列表
													let nowPage = pages[pages.length -
														1]; //当前页页面实例
													let prevPage = pages[pages.length -
														2]; //上一页页面实例
													prevPage.$vm.init();
													uni.navigateBack({ //uni.navigateTo跳转的返回，默认1为返回上一级
														delta: 1
													});
												}, 1000);
											} else if (res.data.code ==
												'50000') { //20240205判断组托计划锁定
												uni.showToast({
													title: res.data.msg,
													icon: 'none',
													duration: 5000
												});
											} else {
												uni.showToast({
													title: res.data.msg,
													icon: 'none',
													duration: 4000
												});
											}

										}
									})
								}
							}

						}
					}
				})
			},

			reduceUsed() {
				//先找需要扫描越库的数据
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var that = this;
				for (var i = 0; i < that.detailList.length; i++) {
					if (that.detailList[i].isFreeze) {
						that.scanedList.push(that.detailList[i]);
					}
				}
				uni.request({
					url: this.baseUrl + '/system/pkgline/plan',
					data: {
						productList: that.scanedList,
						type: 'reduce',
						orgId: this.orgId,
						userName: this.userName
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						if (res.data.code == '200') {
							//this.unregisterScan();
							//player.stop();
							let pages = getCurrentPages(); //获取所有页面栈实例列表
							let nowPage = pages[pages.length - 1]; //当前页页面实例
							let prevPage = pages[pages.length - 2]; //上一页页面实例
							prevPage.$vm.init();
							setTimeout(function() {
								uni.navigateBack({ //uni.navigateTo跳转的返回，默认1为返回上一级
									delta: 1
								});
							}, 1000);
							//隐藏加载框
							uni.hideLoading();
						} else if (res.data.code == '50000') { //20240205判断组托计划锁定
							uni.showToast({
								duration: 4000,
								icon: 'none',
								title: '该组托计划正在做变更已被锁定,不允许操作!'
							})
						}
					}
				})
			},


			dialogConfirm() {
				//先找需要扫描越库的数据
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var that = this;
				if (that.itemCode == null || that.itemCode == "") {
					uni.showToast({
						title: '物料编码不能为空',
						icon: 'none',
						duration: 3000
					});
					return;
				}
				if (that.number == null || that.number == "") {
					uni.showToast({
						title: '数量不能为空',
						icon: 'none',
						duration: 3000
					});
					return;
				}
				var flag = false;
				for (var i = 0; i < that.needAdd.length; i++) {
					var data = that.needAdd[i];
					if (data.itemCode == that.itemCode && data.num > 0) {
						flag = true;
						data.num = data.num - 1;
						break;
					}
				}
				// for(var i=0;i<that.detailList.length;i++){
				// 	var data = that.detailList[i];
				// 	if((data.boxCode == null || data.boxCode == '') && data.itemCode == that.itemCode){
				// 		flag = true;
				// 		//data.num = data.num - 1;
				// 		break;
				// 	}
				// }
				if (!flag) {
					//隐藏加载框
					uni.hideLoading();
					uni.showToast({
						title: '此箱非本计划物品无法加到托盘中！',
						icon: 'none',
						duration: 3000
					});
					return;
				} else {
					//隐藏加载框
					uni.hideLoading();
					uni.showModal({
						title: '是否加入到托盘中？',
						content: '物料编码：' + that.itemCode + "\n" + "数量：" + that.number + "\n" + '批次号：' + that
							.boxCode + '\n',
						success: function(res) {
							if (res.confirm) {
								that.barCode();
							} else if (res.cancel) {

							}
						}
					});
				}
			},

			//调用条码主档
			barCode() {
				var that = this;
				let token = getToken();
				uni.request({
					url: that.baseUrl + '/system/barcode',
					data: {
						code: that.itemCode,
						codeEqualQty: that.number,
						boxCode: that.boxCode,
						sourceBill: 'MD_ITEM', //单据类型是物料
						orgId: this.orgId,
						userName: this.userName
					},
					method: 'POST',
					header: {
						'authorization': token
					},
					dataType: 'json',
					success: (res) => {
						if (res.data.code == '200') {
							var json = JSON.parse(res.data.msg);
							var barcodeId = json.barcodeId;
							that.isAdd(barcodeId);
						} else if (res.data.code == '201') {
							uni.showToast({
								title: '此箱已扫描',
								icon: 'none',
								duration: 2000
							});
							that.itemCode = '';
							that.number = '';
							that.boxCode = '';
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
							that.itemCode = '';
							that.number = '';
							that.boxCode = '';
						}
						that.$refs.alertDialog.close();
					}
				})
			},

			isAdd(barcodeId) {
				var that = this;
				uni.request({
					url: that.baseUrl + '/system/pkgline/plan',
					data: {
						packageId: that.packageId,
						boxcode: that.boxCode,
						panelCode: that.panelCode,
						itemCode: that.itemCode,
						type: 'isAdd',
						orgId: this.orgId,
						userName: this.userName
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {
						console.log(res)
						if (res.data.code == '200') {
							var result = res.data.data;
							var arr = {
								panelLineid: result.panelLineid,
								itemCode: result.itemCode,
								itemName: result.itemName,
								batchCode: result.batchCode,
								isFreeze: true,
								codeEqualQty: result.codeEqualQty,
								isAdd: true,
								barcodeId: result.barcodeId,
								boxCode: that.boxCode
							};
							that.detailList.push(arr);
							//that.scanedList.push(arr);
						} else if (res.data.code == '50000') { //20240205判断组托计划锁定
							uni.showToast({
								duration: 4000,
								icon: 'none',
								title: '该组托计划正在做变更已被锁定,不允许操作!'
							})
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 3000
							});
						}
						that.itemCode = '';
						that.number = '';
						that.boxCode = '';
					}
				})
			},



			dialogClose() {
				this.itemCode = '';
				this.number = '';
				this.boxCode = '';
				this.$refs.alertDialog.close();
			},

			tipConfirm() {
				//先找需要扫描越库的数据
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var that = this;
				var data = that.datas
				var updateFlag = false;
				var record = '';
				for (var i = 0; i < that.detailList.length; i++) {
					if (data.itemCode == that.detailList[i].itemCode && data.codeEqualQty == that.detailList[i]
						.codeEqualQty &&
						!that.detailList[i].isFreeze) {
						//this.detailList[i].isFreeze = true;
						//this.detailList[i].boxCode = this.boxCode;
						//this.panelLineid = this.detailList[i].panelLineid;
						updateFlag = true;
						that.detailList[i].storageArea = data.storageArea;
						record = that.detailList[i];
						break;
					}
				}
				if (updateFlag) {
					that.updatePackage(record);
				}
				that.$refs.tipDialog.close();
				//隐藏加载框
				uni.hideLoading();
			},

			tipClose() {
				this.$refs.tipDialog.close();
			},

			prompt(type) {
				var innerAudioContext = uni.createInnerAudioContext();
				innerAudioContext.autoplay = true;
				innerAudioContext.src = '/static/mp3/success.mp3';
				//innerAudioContext.play();//铃声文件的路径
				//innerAudioContext.stop();
				innerAudioContext.onPlay(() => {
					console.log('开始播放');
				});
				innerAudioContext.onError((res) => {
					console.log(res.errMsg);
					console.log(res.errCode);
				});
				innerAudioContext.onPause(function() {
					console.log('end');
					innerAudioContext.destroy()
				})
			},

			//长按删除
			touchstart(index) {
				let that = this;

				clearInterval(this.Loop); //再次清空定时器，防止重复注册定时器

				this.Loop = setTimeout(function() {

					uni.showModal({

						title: '删除',

						content: '确定要删除本条消息吗？',

						success: async function(res) {

							if (res.confirm) {
								console.log('用户点击确定1');
								//var id = that.list[index].id

								//let data = await that.$http.post('api/shop/shop_qualification_image/delete',{

								//'id':id,

							} else if (res.cancel) {
								console.log('用户点击取消')
							}
						}
					});

				}.bind(this), 1000);

			},

			touchend() {
				clearInterval(this.Loop);
			},
		}
	}
</script>

<style lang="less">
	page {
		width: 100%;
		height: 100%;
	}


	.scrool-page {
		display: flex;
		flex-direction: column;
		width: 100%;
		height: 100%;
	}

	.header-cont {
		width: 100%;
		height: 110rpx;
		line-height: 100rpx;
		text-align: center;
		// background: red;
	}

	.list-cont {
		flex: 1;
		position: relative;

		.scrool-more {
			position: absolute;
			left: 0;
			right: 0;
			top: 0;
			bottom: 0;
		}

		.list {
			height: 80rpx;
			line-height: 80rpx;
			text-align: center;
			background: #e0e0e0;

		}
	}


	.footer {
		color: #fff;
		line-height: 100rpx;
		flex: 0 0 100rpx;
		/* 不放大不缩小固定100rpx */
	}

	.content {
		font-size: 28upx;
	}
</style>